home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 2187 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: onramp.arc.nasa.gov!usenet
  2. From: lwilliam@pioneer.arc.nasa.gov (Tom)
  3. Newsgroups: comp.sys.cbm
  4. Subject: Re: Want to read/record temp with c64
  5. Date: Fri, 09 Feb 1996 09:26:33 GMT
  6. Organization: Lone Tree Works
  7. Message-ID: <4ff413$jeb@onramp.arc.nasa.gov>
  8. References: <4e75jl$je4@news.csus.edu>
  9. Reply-To: lwilliam@pioneer.arc.nasa.gov
  10. NNTP-Posting-Host: arc-tac2-slip6.nsi.nasa.gov
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. mrubin@gallium (Mark Rubin) wrote:
  14.  
  15. >I would like to hook up a sensor to one of my spare c64s to read and
  16. >record outside temperatures.
  17.  
  18. I dabbled in this once many years ago.
  19.  
  20. I used a temperature sensor from an old electronic thermometer - really a
  21. thermal resistor - and attached it to the joystick port, one side to +5v, the
  22. other to a paddle input.  A memory location would hold the resultant value,
  23. 0-255.  Adding a couple variable resistors, one in series, one in parallel,
  24. would allow hardware adjustment of the sensitivity and range.
  25.  
  26. Software would need tweaking to pick the useable range and increment, but is
  27. otherwise extremely simple: read the port, do the math, display the number,
  28. repeat.
  29.  
  30. I did calibration with cooking oil, which proved to hold its temp longer than
  31. water, and an accurate thermometer, alternately warming the oil on the stove
  32. and cooling in an icewater bath.  Remember to water-seal the sensor if you
  33. don't use a pre-sealed unit.
  34.  
  35. Two software appraoches are possible: table lookup and algebraic calculation.
  36. Table lookup requires the most testing, as you would create a table of
  37. register values for each temperature you indicate, though takes less
  38. brainstorming to program.  Algebraic calculation requires you create a formula
  39. to determine the reading and does require a few samples in a table to start,
  40. possibly a graph.
  41.  
  42. Have fun!
  43.  
  44.  
  45.